package com.itcast.Web;

import com.itcast.Dao.PublicDao;
import com.itcast.factory.PublicFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppFactory {
    public static void main(String[] args) {

//        PublicDao publicDao = PublicFactory.getPublicDao();
//        publicDao.save();
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        PublicDao publicDao = (PublicDao) ctx.getBean("publicDao");
        publicDao.save();
        ctx.close();
    }
}
